package com.judysen.jsqlweb.controller;

import com.judysen.jsqlweb.controller.models.ReqLoginModel;
import com.judysen.jsqlweb.models.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户管理
 */
@RestController
@RequestMapping("/api/user")
public class UserController {
    @PostMapping("/login")
    public RestResult login(@RequestBody ReqLoginModel reqLoginModel){
        if("admin".equals(reqLoginModel.getUsername())&&"111111".equals(reqLoginModel.getPassword())){
            return new RestResult(200,"","admin");
        }

        return new RestResult(401,"您没有权限登录",false);
    }
}
